const { Sequelize } = require('sequelize');
const {
 MYSQL_HOST,
 MYSQL_POER,
 MYSQL_USER,
 MYSQL_PWD,
 MYSQL_DB
} = require('../config/config.default')

const seq = new Sequelize(MYSQL_DB, MYSQL_USER, MYSQL_PWD, {
 host: MYSQL_HOST,
 port: MYSQL_POER,
 dialect: 'mysql'
})

seq.authenticate().then(() => {
 console.log('database connect success')
}).catch((err) => {
 console.log('database connect error', err)
})

module.exports = seq
